'use strict';

angular.module('fbdApp.auxModule')

.directive('compile', function($compile) {
  return {
    // scope:
    strict: 'A',
    replace: true,
    link: function(scope, elem, attrs) {
      scope.$watch(attrs.compile, function(html) {
        // console.log(html);
        elem.html(html);
        // console.log(elem.contents());
        $compile(elem.contents())(scope);
      });
    }
  };
});
